package com.jboa.vo;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class PageHelper {
	private int pageno=1;//页码
	private int pagesize=5;//页面大小
	private int pagetotal=1;//总页数
	private Long totalcount;//总记录数
	//业务条件
	private HashMap params=new HashMap(); 
	//集合
	private List<BizClaimVoucher> voucherLs=new ArrayList<BizClaimVoucher>(); 
	//请假单
	private List<BizLeave> leave=new ArrayList<BizLeave>();
	private boolean ifnext;//是否有下一页
	private boolean ifback;//是否有上一页
	//起始行下标
	public int startRow(){
		return (pageno-1)*pagesize;
	}
	public int getPageno() {
		return pageno;
	}
	
	public void setPageno(int pageno) {
		if(pageno>0){
			this.pageno = pageno;
		}
	}
	public int getPagesize() {
		return pagesize;
	}
	public void setPagesize(int pagesize) {
		if(pagesize>0){
			this.pagesize = pagesize;
		}
	}
	public int getPagetotal() {
		return pagetotal;
	}
	public void setPagetotal(int pagetotal) {
		if(pagetotal>=0){
			this.pagetotal = pagetotal;
		}
	}
	public Long getTotalcount() {
		return totalcount;
	}
	public void setTotalcount(Long totalcount) {
		if(totalcount>=0){
			this.totalcount = totalcount;
		}
		this.pagetotal=(int) (totalcount%pagesize==0?totalcount/pagesize:totalcount/pagesize+1);

	}
	
	public HashMap getParams() {
		return params;
	}
	public void setParams(HashMap params) {
		this.params = params;
	}
	
	public boolean isIfnext() {
		if(pageno<pagetotal){
			return true;
		}else{
			return false;
		}
	}
	
	
	public List<BizClaimVoucher> getVoucherLs() {
		return voucherLs;
	}
	public void setVoucherLs(List<BizClaimVoucher> voucherLs) {
		this.voucherLs = voucherLs;
	}
	public List<BizLeave> getLeave() {
		return leave;
	}
	public void setLeave(List<BizLeave> leave) {
		this.leave = leave;
	}
	public boolean isIfback() {
		if(pageno>1){
			return true;
		}else{
			return false;
		}
	}
}
